//vue3中防抖函数hook
export const useDebounce = (fn: Function, delay: number) => {
    let timer: any;
    return (...args: any) => {
        if (timer) clearTimeout(timer);
        timer = setTimeout(() => {
            fn(...args);
        }, delay);
    };
};
